package com.happiness.base.bean;

import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@ApiModel("分页请求返回体")
@EqualsAndHashCode(callSuper = false)
public class ResponsePageInfo<T> extends PageInfo<T> {
    @ApiModelProperty("数据")
    private List<T> list;
    @ApiModelProperty("页数")
    private int page;
    @ApiModelProperty("每页记录数")
    private int pageSize;
    @ApiModelProperty("是否还有上一页")
    private boolean hasPreviousPage;
    @ApiModelProperty("是否还有下一页")
    private boolean hasNextPage;
    @ApiModelProperty("总页数")
    private int pages;
    @ApiModelProperty("上一页")
    private int prePage;
    @ApiModelProperty("下一页")
    private int nextPage;
    @ApiModelProperty("总记录数")
    private long total;

    public ResponsePageInfo(List<T> list) {
        super(list);
    }

    public List<T> getList() {
        return super.getList();
    }

    public int getPage() {
        return super.getPageNum();
    }


}
